﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PharmacyPharnet;
using Pharmacy.Ultilities.Localization;
using PharmacyPharnet.Core;
using Pharmacy.Ultilities.Resources;

namespace Pharmacy.UnitTest
{
    [TestClass]
    public class UNTMultiLanguage
    {
        [TestInitialize]
        public void InitializeMultiLangauge()
        {
            LocalizerText.InitializeMultiLanguage();
        }

        /// <summary>
        /// trường hợp chưa có file language xml
        /// </summary>
        public void InsertTextToFile()
        {
            LocalizerText.WriteTextToFile("NSDPS", "sds");
        }

        /// <summary>
        /// lấy nội dung trong language file của text hiện tại
        /// </summary>
        public void GetText()
        {
            string key = "TAM123";
            LocalizerText.GetText(key, "Test");
        }

        /// <summary>
        /// lấy nội dung trong language file từ key trong resources
        /// </summary>
        public void GetTextFromResource()
        {
            string msg = SR.Instance.GetString("InvalidDirectorPath");
        }

        /// <summary>
        /// apply multi language trên giao diện
        /// </summary>
        [TestMethod]
        public void ApplyMultiLanguageForForm()
        {
            FrmLogin frm = new FrmLogin();
            //LocalizerView.ApplyLanguage(frm);
            frm.Show();
        }
    }
}
